/* randomgraphreader.h
Desc.: Implementation of a graph reader class that gives edges in random order
Auth.: Ashwin Lall
Start: March 19, 2014
*/

#ifndef _RANDOMGRAPHREADER_H
#define _RANDOMGRAPHREADER_H

#include <map>
#include <string>
#include <fstream>
using namespace std;

class RandomGraphReader
{
public:
    // constructor
    RandomGraphReader(string filename, int seed);    

    // accessor
    bool nextEdge(int &node1, int &node2);  // returns true iff there is another edge, with vertices in node1/node2

    // destructor (needed since we use dynamic memory)
    ~RandomGraphReader();

protected:
    ifstream _file;
    int * _edges;
    map<int, int> _label;
    int _curr, _numedges;
};

#endif
